import { API_ROOT } from '../config'
import { postJson, fetch } from '../service/httpService'
 
//登录接口
export const postLogin = body => {
  return postJson(API_ROOT + 'login', body)
}
   
//上传
export const uploadSign = body => {
    return fetch(API_ROOT + 'upload-sign', body)
}

//oss签名
export const fetchOssSign = body => {
  return fetch(API_ROOT + 'oss/sign', body)
}


//课程

// 课程列表
export const fetchSubjectList = body => {
    return fetch(API_ROOT + 'subject/list', body)
}
//新增课程
export const addSubjectItem = body => {
    return postJson(API_ROOT + 'subject/create', body)
}
//编辑课程
export const editSubject = body => {
    return postJson(API_ROOT + 'subject/edit/'+body.id,body.data )
}
//删除课程
export const deleteSubject = body => {
    return postJson(API_ROOT + 'subject/del/'+body, )
} 

// 课程订阅
// 课程订阅列表
export const fetchSectionList = body => {
    return fetch(API_ROOT + 'section/list', body)
}
//新增课程订阅
export const addSectionItem = body => {
    return postJson(API_ROOT + 'section/create', body)
}
//编辑课程订阅
export const editSection = body => {
    return postJson(API_ROOT + 'section/edit/'+body.id,body.data )
}
//删除课程订阅
export const deleteSection = body => {
    return postJson(API_ROOT + 'section/del/'+body, )
} 


 

 



